﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IgisApi;


namespace IGIS
{
    public partial class login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
        {
            using (HetzEntities db = new HetzEntities())
            { 
            
             user  log=  db.users.FirstOrDefault(x=>(x.username == Login1.UserName) && (x.password ==Login1.Password));
             if (null != log)
             {
                 if (!string.IsNullOrEmpty(log.username))
                 {
                     Session["logedin"] = "true";
                     Response.Redirect("default.aspx");
                   
                 }
             }
                         
                         }
        }
    }
}